package com.gqzmy.springboot3.listener;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * @author 周小哥 gqzmy@163.com 
 * @since 2023/4/4 8:47
 */
@Component
public class ListenerEvent {

	@EventListener({UserChangePasswordEvent.class})
	public void LogListener(UserChangePasswordEvent event) {
		System.out.println("收到事件:" + event);
		System.out.println("开始执行业务操作生成关键日志。用户userId为：" + event.getUserId());
	}

	@EventListener({UserChangePasswordEvent.class})
	public void messageListener(UserChangePasswordEvent event) {
		System.out.println("收到事件:" + event);
		System.out.println("开始执行业务操作给用户发送短信。用户userId为：" + event.getUserId());
	}
}


